﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using CaiyinSoft.NetGather.Protocol;

namespace CaiyinSoft.NetGather.NetGatherLib.Tools
{
    public partial class HTMLSourceForm : InnerFormBase
    {
        public HTMLSourceForm()
        {
            InitializeComponent();
        }

        private IHTMLFilter _filter;
        public IHTMLFilter Filter
        {
            get
            {
                return _filter;
            }
            set
            {
                _filter = value;
                txtSource .Clear();
                List<FilterResult> results = _filter.GetInputHTML();
                if (results == null) return;
                foreach (var result in results)
                {
                    txtSource.AppendText(result.HTMLResult);
                    txtSource.AppendText(Environment.NewLine);
                }

            }
        }
    }
}
